package com.mshop.service;

import java.util.List;

import com.mshop.fw.modules.CommonService;
import com.mshop.po.SysPower;
import com.mshop.util.QL;

public class SysPowerService extends CommonService {
	public List<SysPower> list(String managerId) {
		return dao.find(SysPower.class, QL.HQL.SYSPOWER.LIST, new Object[] {new Long(managerId)});
	}

	public void save(SysPower sysPower) {
		dao.save(sysPower);
	}

	public SysPower get(String id) {
		return dao.get(SysPower.class, new Long(id));
	}
	
	public SysPower load(String id) {
		return dao.load(SysPower.class, new Long(id));
	}

	public void delete(String id) {
		dao.delete(this.get(id));
	}

	public void deleteByMenuId(String menuId) {
		dao.executeByHQL(QL.HQL.SYSPOWER.DELETE_BY_MENUID, new Object[]{new Long(menuId)});
	}
	
	public void deleteByManagerId(String managerId) {
		dao.executeByHQL(QL.HQL.SYSPOWER.DELETE_BY_MANAGERID, new Object[]{new Long(managerId)});
	}
}
